Skip to content

Comments

chore: add metric definitions#92

Merged
pyropy merged 6 commits intomainfrom
chore/add-metric-definitions
Feb 18, 2026
Merged

chore: add metric definitions#92
pyropy merged 6 commits intomainfrom
chore/add-metric-definitions

Conversation

@pyropy
Copy link
Member

@pyropy pyropy commented Jan 28, 2026

@vercel
Copy link

vercel bot commented Jan 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
filecoin-pay-explorer Ready Ready Preview, Comment Feb 12, 2026 0:47am

Request Review

Copy link
Member Author

@pyropy pyropy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @davidgasquez let's start a discussion on metrics here 🙌🏻

- **Formula:** `Σ(account.userTokens.lockupCurrent)` converted from wei (18 decimals) to USDFC
- **Note:** Same metric as GA Mode. Displayed between Active Payers and USDFC Settled.

#### Total Settled (USDFC)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we only interested in displaying USDFC settlement? What about native (FIL) settlements? Do we need separate metric for those?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this also a duplicate metric (there is USDFC Settled (Cumulative) above)?

- **Formula:** `Σ(account.userTokens.lockupCurrent)` converted from wei (18 decimals) to USDFC
- **Note:** This represents the total amount of USDFC that has been deposited and is locked to secure active payment rails. Displayed between Active Payers and USDFC Settled.

#### USDFC Settled (Cumulative)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we interested in native token settlements?

@pyropy
Copy link
Member Author

pyropy commented Jan 28, 2026

@timfong888 I went over your dashboard prototype and reviewed some of the metrics and stuff displayed over there. It's more of a general feedback / questions on what we want to display as that will shape what we put into the METRICS-DEFINITIONS.md file

Main page (Dashboard)

  • We should either leave total active payers chart or just display the number of total active payers, I don’t see the need for both
  • Total USDFC settled chart can replace both the “USDFC Settled” and “Settled (7d)” cards by showing last settlement time series data for last 7 days. Based on this chart we can make an estimate of how much USDFC has been settled in the last 7 days (i.e. on Monday total was $1000 and on Sunday it’s $1200 meaning there was $200 worth of settlements in the last 7 days)
  • “Current Auction Price” can show the current price of USDFC in FIL but cannot show the actual bid. As I understand the current bidding system will swap the FIL -> USDFC if the price matches the current price, hence there is no competing bids.
  • Definition for “Total Auction Volume” is “The cumulative amount of USDFC bid so far in the auction” but I would change the definition to “Total USDFC Volume auctioned”.
  • “Total Auction Participants” would show unique number of addresses that performed a successful bid (which is basically a swap, correct me if I’m wrong)
  • Top 10 Payers sounds like a good section. If people don’t find that valuable we can switch it for last 10 settlements or something like that.

Payer accounts page

  • Same comments apply related to showing USDFC settlements in multiple ways as above. We should either stick to cards or charts IMO.

Payee accounts page

  • All looks good here. If we decide to add the PDP data set details to the explorer having “Total Data Stored” card makes sense.

Payer Details

  • Personally I would remove the “My Data” section or at least the search bar for CID search.
  • There is a singular “Settle” button (!) where the settlements are actually per rail. Instead I would suggest adding this button to each payment rail in the “Payment rails” section.

Payee details

  • “Claimable Now” can maybe be renamed to “Available for settlement” or something like that. I think we should stick with one term, that one being settlement.
  • “Total Received” does this include one-time payments? If not perhaps better name is “Total Settled”
  • “Monthly Run Rate” I’m not exactly sure about the definition on this one? Maybe someone could explain it briefly?

cc @geomatrick I know Tim and you have worked on this quite a bit, so maybe you have also some feedback on what metrics we'd like to display?

@pyropy pyropy moved this from 📌 Triage to ⌨️ In Progress in FOC Jan 28, 2026
@pyropy pyropy self-assigned this Jan 28, 2026
### Settled (7d)
- **Definition:** USDFC settled by this payer in the last 7 days
- **Source:** `Settlement` events filtered by payer address and timestamp
- **Formula:** `Σ(settlement.totalSettledAmount)` where `settlement.rail.payer.address == payerAddress AND timestamp >= now - 7 days`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Formula:** `Σ(settlement.totalSettledAmount)` where `settlement.rail.payer.address == payerAddress AND timestamp >= now - 7 days`
- **Formula:** `Σ(settlement.totalSettledAmount)` where `settlement.rail.payer.address == payerAddress AND settlement.rail.token == USDFC_ADDRESS AND timestamp >= now - 7 days`

@rjan90 rjan90 added this to the M4.0: mainnet staged milestone Jan 28, 2026
@rjan90 rjan90 linked an issue Jan 28, 2026 that may be closed by this pull request
Copy link
Contributor

@BigLep BigLep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a blocking approver here. I wanted to read it to be more aware of how things worked, but please feel free to proceed without further review from me.

- **Definition:** Total USDFC currently locked across all accounts for future payments
- **Source:** Sum of `Account.userTokens.lockupCurrent` from Goldsky subgraph
- **Formula:** `Σ(account.userTokens.lockupCurrent)` converted from wei (18 decimals) to USDFC
- **Note:** This represents the total amount of USDFC that has been deposited and is locked to secure active payment rails. Displayed between Active Payers and USDFC Settled.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what "Displayed between Active Payers and USDFC Settled" menas.

Copy link

@davidgasquez davidgasquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple of questions. Thanks for opening starting the discussion @pyropy, it's been helpful

We should either leave total active payers chart or just display the number of total active payers, I don’t see the need for both

I think the chart might be "incorrect" as it is looking at the current state so historical values will change. It'll be always growing and monotonic even if from one day to another it goes down by 10 active payers.

- **Formula:** `Σ(account.userTokens.lockupCurrent)` converted from wei (18 decimals) to USDFC
- **Note:** Same metric as GA Mode. Displayed between Active Payers and USDFC Settled.

#### Total Settled (USDFC)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this also a duplicate metric (there is USDFC Settled (Cumulative) above)?

@davidgasquez
Copy link

In case it is helpful, I'm working on the same metrics using the existing definition but deriving everyghing from the FEVM logs.

image

@pyropy
Copy link
Member Author

pyropy commented Jan 29, 2026

Linking this comment here.

We might want to wait with metric definitions until we have subgraph ready. Depending on the subgraph formulas to get the metrics might change.

As for definitions, we'd only need three:

  1. Total USDFC & FIL locked in payment rails
  2. Total USDFC & FIL transacted (cumulative)
  3. Total FIL burned from Filecoin Pay (cumulative)

@timfong888
Copy link

@davidgasquez for myself to understand the stack, what is pipeline you have set up to use EVM Logs?

REgarding the other questions, I belive the PDP verifier contract was where I found data size. It is not in the pay contract.

@davidgasquez
Copy link

what is pipeline you have set up to use EVM Logs?

I'm working on the pipeline but for now, Riba has published the result of the eth_getLogs call for all heights since October (e.g. https://ribrpc.fil.st/archive/fil/mainnet/2026/01/21/eth_getLogs.v1.r1.flattened.ndjson.zst).

I'm ingesting these and then decoding all the events from any contract ABI I can get my hands into.

That gives me all the events with their args as JSON that I have to parse into entities (accounts) and metrics.

With this pipeline, I just need to tweak the SQL transformations and rerun it (1 second) to tweak the metrics.

@pyropy pyropy changed the title WIP chore: add metric definitions chore: add metric definitions Feb 9, 2026
@pyropy pyropy marked this pull request as ready for review February 9, 2026 17:16
@pyropy pyropy requested review from BigLep and silent-cipher and removed request for BigLep, geomatrick and jennijuju February 9, 2026 17:17
@pyropy pyropy moved this from ⌨️ In Progress to 🔎 Awaiting review in FOC Feb 9, 2026
@github-project-automation github-project-automation bot moved this from 🔎 Awaiting review to ✔️ Approved by reviewer in FOC Feb 12, 2026
@pyropy pyropy merged commit f73401d into main Feb 18, 2026
4 checks passed
@github-project-automation github-project-automation bot moved this from ✔️ Approved by reviewer to 🎉 Done in FOC Feb 18, 2026
@pyropy pyropy deleted the chore/add-metric-definitions branch February 18, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

metrics criteria has been reviewed and accepted by engineering

6 participants